//引入util js
var _util = require('util/util.js');

//account_service
var _other_service = {
    getallorders : function(status,pagesize,pageid,resolve,reject){
        _util.request({
            url     : _util.getServerURL("/admin/order/orders/pages/" +pagesize+"/"+pageid +"?status=" + status),
            method  : 'GET',
            success : resolve,
            error   : reject,
        });
    },
    getorderbyid : function(orderid,resolve,reject){
        _util.request({
            url     : _util.getServerURL("/admin/order/orders/"+orderid+"/detail"),
            method  : 'GET',
            success : resolve,
            error   : reject,
        });
    },
    getrefundorderbyid : function(reufundorderid,resolve,reject){
        _util.request({
            url     : _util.getServerURL("/admin/order/orders/refund/"+reufundorderid ),
            method  : 'GET',
            success : resolve,
            error   : reject,
        });
    },
    refusereturn : function(orderid,refundreason,resolve,reject){
        _util.request({
            url     : _util.getServerURL("/admin/order/orders/"+orderid+"/refusereturn"),
            data    : {
                refusalreason : refundreason
            },
            method  : 'POST',
            success : resolve,
            error   : reject,
        });
    },
    confirmreturn : function(orderid,resolve,reject){
        _util.request({
            url     : _util.getServerURL("/admin/order/orders/"+orderid+"/confirmreturn"),
            method  : 'POST',
            success : resolve,
            error   : reject,
        });
    },
}

module.exports = _other_service;